package com.dsh.vegetable.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import com.dsh.vegetable.dao.VegetableGroupDao;
import com.dsh.vegetable.entity.VegetableGroup;

/**
 * @author robot
 *
 */
@Repository
public class VegetableGroupDaoImpl implements VegetableGroupDao {

	private SqlSessionTemplate sqlSession;
	@Resource(name = "sqlSession")
	/**
	 * @param sqlSession the sqlSession to set
	 */
	public void setSqlSession(SqlSessionTemplate sqlSession) {
		this.sqlSession = sqlSession;
	}
	/**
	 * @return the sqlSession
	 */
	public SqlSessionTemplate getSqlSession() {
		return sqlSession;
	}
	@Override
	public List<VegetableGroup> getListById(VegetableGroup bean) {
		// TODO Auto-generated method stub
		List<VegetableGroup> list = sqlSession.selectList("VegetableGroup.getListById", bean);
		return list;
	}
	@Override
	public List<VegetableGroup> getListByGroupId(VegetableGroup bean) {
		// TODO Auto-generated method stub
		List<VegetableGroup> list = sqlSession.selectList("VegetableGroup.getListByGroupId", bean);
		return list;
	}
	@Override
	public List<VegetableGroup> getListByShopId(VegetableGroup bean) {
		// TODO Auto-generated method stub
		List<VegetableGroup> list = sqlSession.selectList("VegetableGroup.getListByShopId", bean);
		return list;
	}
	@Override
	public List<VegetableGroup> getListByCreateDate(VegetableGroup bean) {
		// TODO Auto-generated method stub
		List<VegetableGroup> list = sqlSession.selectList("VegetableGroup.getListByCreateDate", bean);
		return list;
	}
	@Override
	public List<VegetableGroup> getListByUpdDate(VegetableGroup bean) {
		// TODO Auto-generated method stub
		List<VegetableGroup> list = sqlSession.selectList("VegetableGroup.getListByUpdDate", bean);
		return list;
	}
	@Override
	public List<VegetableGroup> getListByCreateId(VegetableGroup bean) {
		// TODO Auto-generated method stub
		List<VegetableGroup> list = sqlSession.selectList("VegetableGroup.getListByCreateId", bean);
		return list;
	}
	@Override
	public List<VegetableGroup> getListByUpdDateId(VegetableGroup bean) {
		// TODO Auto-generated method stub
		List<VegetableGroup> list = sqlSession.selectList("VegetableGroup.getListByUpdDateId", bean);
		return list;
	}
	@Override
	public int deleteVegetableFGroupById(VegetableGroup bean) {
		// TODO Auto-generated method stub
		int rs = sqlSession.delete("VegetableGroup.deleteVegetableFGroupById", bean);
		return rs;
	}
	@Override
	public int insertVegetableGroup(VegetableGroup bean) {
		// TODO Auto-generated method stub
		int rs = sqlSession.insert("VegetableGroup.insertVegetableGroup", bean);
		return rs;
	}
	@Override
	public int updateVegetableGroup(VegetableGroup bean) {
		// TODO Auto-generated method stub
		int rs = sqlSession.update("VegetableGroup.updateVegetableGroup", bean);
		return rs;
	}
	

}
